//
//  main.m
//  HomeWork 02 - 完成分数练习 及 预习 NSString
//
//  Created by dllo on 16/7/5.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Fraction.h"
int main(int argc, const char * argv[]) {
    Fraction *f = [Fraction fractionWithNum:2 demo:3];
    Fraction *f1 = [Fraction fractionWithNum:1 demo:2];
    // 比较大小
    [f compareFraction:f1];
    // 约分
    Fraction *f2 = [Fraction fractionWithNum:3 demo:6];
    [f2 reduce];
    NSLog(@"约分：%ld / %ld",f2.numerator,f2.denorminator);
    //和
    Fraction *f3 = [f addFraction:f1];
    NSLog(@"和：%ld / %ld",f3.numerator,f3.denorminator);
    //减法
    Fraction *f4 = [f minusFraction:f1];
    NSLog(@"差：%ld / %ld",f4.numerator,f4.denorminator);
    
    // 乘
    Fraction *f5 = [f mulFraction:f1];
    [f5 reduce];
    NSLog(@"积：%ld / %ld",f5.numerator,f5.denorminator);
    
    // 除法
    
    Fraction *f6 = [f divisionFraction:f1];
    NSLog(@"商：%ld / %ld",f6.numerator,f6.denorminator);
    
    

    
    
    
    
    
    
    
    return 0;
}
